'    Copyright (C) <2008>  <Kevin Pletinckx>
'
'    This program is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.
'
'    This program is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.
'
'    You should have received a copy of the GNU General Public License
'    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Public Class frmFirstTime
    Dim objIniFile As New IniFile(My.Settings.INI_Location)
    Private Sub frmFirstTime_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        'Closes Reela.vb if this form is closed.
        frmReela.Close()
    End Sub

    Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
        'Opens filebrowser for the TopLogo image.
        OpenFileDialog1.ShowDialog()
        txtIni.Text = OpenFileDialog1.FileName
    End Sub

    Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        'Checks if the file entered is the correct file.
        Dim fileExists As Boolean
        fileExists = My.Computer.FileSystem.FileExists(txtIni.Text)
        If fileExists = False Then
            MsgBox("This file does not exist. Please enter the correct file.")
            Exit Sub
        End If

        'Save the settings.
        My.Settings.INI_Location = txtIni.Text
        MsgBox("Please restart Reela to start using it.", MsgBoxStyle.Information, "Please restart")
        frmReela.Close()

    End Sub

    Private Sub frmFirstTime_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        frmReela.ShowInTaskbar = False
        frmReela.Hide()
    End Sub
End Class